import { createApp } from 'vue'
import App from './App.vue'
import { createPinia } from 'pinia'
import { createPersistedState } from 'pinia-plugin-persistedstate'
import { encryptedStorage } from './plugins/encryptedStorage'
import 'element-plus/dist/index.css'
import router from './router'
import i18n from './i18n'
import './style/themes.scss'
const app = createApp(App)
const pinia = createPinia()
pinia.use(
    createPersistedState({
        storage: encryptedStorage,
        key: id => `encrypted_${id}`
    })
)
window.addEventListener('beforeinstallprompt', e => {
    e.preventDefault()
    window.deferredPrompt = e
})

app.use(pinia)
app.use(router)
app.use(i18n)
app.mount('#app')
